package com.lanou.userLogin.order.web.servlet;

import com.lanou.userLogin.order.service.OrderService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/confirmReceiptServlet")
public class ConfirmReceiptServlet extends HttpServlet {

    private OrderService os = new OrderService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取oid
        String oid = req.getParameter("oid");
        int state = Integer.parseInt(req.getParameter("state"));

        //修改订单状态 3->4确认收货
        //转发到我的订单
        os.confirmReceipt(oid,state);
        req.getRequestDispatcher("/myOrderServlet").forward(req,resp);
    }
}
